import SoundUtil from "../../Fantasy/Util/SoundUtil";
import QuestSpawn from "../QuestSpawn";

const {ccclass, property} = cc._decorator;

@ccclass
export default class WriteButtonJs extends cc.Component {

    label;
    init(label){
        this.label = label;
        this.node.getChildByName("label").getComponent(cc.Label).string = label;
    }
    clickButton(){
        if(QuestSpawn.isWrong == true){
            this.node.getComponent(cc.Button).enabled = false;
        }
        SoundUtil.playEffect("music/duoClick");
        this.node.parent.parent.parent.getComponent("WriteQuestJs").setAnswer(this.label);
    }


    start () {

    }

    // update (dt) {}
}
